home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / amos / amoslist.lzh / AMOSLIST / 000092_amos-request@svcs1.digex.net_Mon Sep 4 23:56:02 1995.msg < prev    next >
Internet Message Format  |  1995-10-02  |  5KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224]) by mail1.access.digex.net (8.6.12/8.6.12) with ESMTP id XAA18502;  for <mcox@access.digex.net> ; Mon, 4 Sep 1995 23:56:00 -0400
  2. Received: (from daemon@localhost) by svcs1.digex.net (8.6.12/8.6.12) id WAA02996 for amos-out; Mon, 4 Sep 1995 22:42:53 -0400
  3. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2]) by svcs1.digex.net (8.6.12/8.6.12) with ESMTP id WAA02993 for <amos-list@svcs1.digex.net>; Mon, 4 Sep 1995 22:42:52 -0400
  4. Received: from acs.saultc.on.ca (acs.saultc.on.ca [192.197.90.1]) by mail1.access.digex.net (8.6.12/8.6.12) with ESMTP id WAA13318;  for <amos-list@access.digex.net> ; Mon, 4 Sep 1995 22:42:50 -0400
  5. From: S93044370@acs.saultc.on.ca
  6. Received: from ACS.SAULTC.ON.CA by ACS.SAULTC.ON.CA (PMDF V4.3-11 #4035)
  7.  id <01HUW80ICNVK000AP5@ACS.SAULTC.ON.CA>; Mon, 04 Sep 1995 22:41:42 -0400 (EDT)
  8. Date: Mon, 04 Sep 1995 22:41:42 -0400 (EDT)
  9. Subject: HELP!?!
  10. To: amos-list@access.digex.net
  11. Message-id: <01HUW80IEJEA000AP5@ACS.SAULTC.ON.CA>
  12. X-VMS-To: IN%"amos-list@access.digex.net"
  13. MIME-version: 1.0
  14. Content-type: TEXT/PLAIN; CHARSET=US-ASCII
  15. Content-transfer-encoding: 7BIT
  16. Status: RO
  17. X-Status: 
  18.  
  19. Hi everyone, I was wondering if anyone could help me with this piece of code.
  20. Its still in rough form, but the idea is there, what I need is a scrolling
  21. screen, as you'll see from the program, you first grab the screen with
  22. the mouse, and while holding the mouse button, then when you let go the
  23. screen will scroll or spin, like I want it too. I have figured out the speed
  24. of the screen(in pixels per second) when you let go of the button, but
  25. have a real problem trying to figure out the delay for the scroll after you
  26. let go. I've figured out that the speed and delay are a curve when graphed
  27. and I have not a clue how to program this.
  28.   One thing, make the modification shown below to get the speed at certain
  29. delays, this is how I made the graph, it helped me a bit, but made the job
  30. even harder since I figured that the speed to delay ratio would be a straight
  31. line, but instead its a curve sort of like to top right part of a hyperbola.
  32. If only I could get the formula for a curve from its graph, then this would
  33. all be so simple.
  34.  
  35. So can anyone help me with this, this is for a game I'm making, its sort
  36. of a wheel of fortune type game, I'd gladly give you credit in the game.
  37. I'm also trying to make realistic deceleration of the screen as well, which
  38. has also gave me some grief as well.
  39.  
  40. Feel free to modify the code at will, and make any suggestions that would be
  41. helpful. YOu'd also have to sincere gratitude.
  42.  
  43. ----- CUT HERE ----
  44. Screen Open 0,320,200,32,Lowres
  45. Auto View Off 
  46. Paper 0 : Flash Off : Curs Off 
  47. Gr Writing 0
  48. For I=1 To 30
  49.    Cls Rnd(30)+1
  50.    Ink Rnd(30)+1 : P=Rnd(33)+1 : Set Pattern P
  51.    Bar 0,0 To 15,47
  52.    Ink 2 : Box 0,0 To 15,47
  53.    Ink 2,0 : Text 1,20,Right$(Str$(I),Len(Str$(I))-1)
  54.    Get Icon I,0,0 To 16,48
  55. Next 
  56. Cls 0
  57. Auto View On 
  58. Screen Open 1,960,48,32,Lowres
  59. Screen Display 1,140,40,320,48
  60. Screen Offset 1,320,0
  61. Curs Off : Flash Off : Paper 1 : Cls 
  62. CP=Rnd(29)+1
  63. For I=0 To 59
  64.    Paste Icon I*16,0,CP
  65.    Add CP,1,1 To 30
  66. Next 
  67. CP=20 : SO=320
  68. While MC=0
  69.    MC=Mouse Click
  70.    If MC<>0
  71.       X=X Mouse : Limit Mouse 
  72.       While Mouse Key<>0
  73.          If Timer>10
  74.             If X Mouse>X1
  75.                DIS=Abs(X Mouse-X1)
  76.                D$="right"
  77.             Else If X Mouse<X1
  78.                D$="left"
  79.                DIS=Abs(X Mouse-X1)
  80.             Else 
  81.                D$="none"
  82.             End If 
  83.             X1=X Mouse
  84.             Timer=0
  85.          End If 
  86.          S=SO-(X Mouse-X)
  87.          Screen Offset 1,S,0
  88.          Wait Vbl 
  89.       Wend 
  90.       
  91.       SPEED=DIS/0.166667
  92.  
  93.       'SPEED is the speed in pixels per second that the screen is scrolling when 
  94.       'the mouse button is let go
  95.  
  96.       SO=S : SP=SO+320
  97.    End If 
  98. Wend 
  99.  
  100. Timer=0
  101.  
  102. Repeat 
  103.  
  104.    ' here is where DELAY should be defined
  105.  
  106.    Paste Icon SP,0,CP
  107.    
  108.    For I=SO+1 To SO+16
  109.       Inc NP
  110.       Screen Offset 1,I,0
  111.       For D=1 To DELAY : Next 
  112.  
  113. '      if timer=60
  114. '          default : print np : exit
  115. '      end if
  116.  
  117. '  use the above three lines and change the bottom until timer to 60
  118. '  and where the delay is supposed to be put a for next loop, this will
  119. '  give you the pixels per second speed at that delay, if this will help
  120.  
  121.    Next 
  122.    
  123.    Add SO,16 : Add SP,16 : Add CP,1,1 To 30
  124.    
  125.    If SO=640
  126.       Screen Copy 1,640,0,959,48 To 1,0,0
  127.       SO=0 : SP=320
  128.    End If 
  129.    
  130. Until Timer>=320:rem change this to 60 for a speed test
  131.  
  132. ---- CUT HERE -----
  133.  
  134. Cori Skagen
  135. (s93044370@acs.saultc.on.ca)
  136.  
  137.  
  138.